package Strategy;

/**
 * @ProjectName: 23种设计模式
 * @Package: Strategy
 * @ClassName: CatComparator
 * @Author: renhan
 * @Description:
 * @Date: 2020/11/10 17:49
 * @Version: 1.0
 */
public class CatComparator implements Comparator<Cat>
{

    @Override
    public int compare(Cat o1, Cat o2) {
        if (o1.weight > o2.weight) {return 1;}
        else if(o1.weight < o2.weight) {return -1;}
        return 0;
    }
}
